package com.bw.a1908.adapter;

import android.content.Context;
import android.graphics.Color;

import com.yanyusong.y_divideritemdecoration.Y_Divider;
import com.yanyusong.y_divideritemdecoration.Y_DividerBuilder;
import com.yanyusong.y_divideritemdecoration.Y_DividerItemDecoration;

/**
 * 间隔线
 */
public
class VideoCardDecoration extends Y_DividerItemDecoration {

    public VideoCardDecoration(Context context) {
        super(context);
    }

    @Override
    public Y_Divider getDivider(int itemPosition) {
        if (itemPosition%2==0){
            return new Y_DividerBuilder()
                    .setTopSideLine(true, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setRightSideLine(false, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setBottomSideLine(false, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setLeftSideLine(true, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .create();
        }else {
            return new Y_DividerBuilder()
                    .setTopSideLine(true, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setRightSideLine(true, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setBottomSideLine(false, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .setLeftSideLine(true, Color.parseColor("#FFFAFAFA"), 10, 0, 0)
                    .create();
        }



    }
}
